﻿using System;

namespace _014.委托
{
	internal class Program
	{
		static void Main(string[] args)
		{
			Console.WriteLine(Multiply(1, 2));
			Console.WriteLine(Divide(1, 2));

			// 定义委托
			Mydelegate mydelegate;
			// 指向 乘法
			mydelegate = Multiply;

			Console.WriteLine(mydelegate(1, 2));

		}

		// 函数
		static double Multiply(double a, double b)
		{
			return a * b;
		}
		static double Divide(double a, double b)
		{
			return a / b;
		}

		// 委托
		delegate double Mydelegate(double x, double y);

	}
}
